Python: NameError when trying to print a previously defined variable in an else statement of handlin

visit shbcf.ru